3.5.43 \(\int \frac {\tan ^3(c+d x)}{a+b \sin ^2(c+d x)} \, dx\) [443]

Optimal. Leaf size=64 \[ \frac {a \log (\cos (c+d x))}{(a+b)^2 d}-\frac {a \log \left (a+b \sin ^2(c+d x)\right )}{2 (a+b)^2 d}+\frac {\sec ^2(c+d x)}{2 (a+b) d} \]

[Out]

a*ln(cos(d*x+c))/(a+b)^2/d-1/2*a*ln(a+b*sin(d*x+c)^2)/(a+b)^2/d+1/2*sec(d*x+c)^2/(a+b)/d

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 64, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {3273, 78} \begin {gather*} \frac {\sec ^2(c+d x)}{2 d (a+b)}-\frac {a \log \left (a+b \sin ^2(c+d x)\right )}{2 d (a+b)^2}+\frac {a \log (\cos (c+d x))}{d (a+b)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^3/(a + b*Sin[c + d*x]^2),x]

[Out]

(a*Log[Cos[c + d*x]])/((a + b)^2*d) - (a*Log[a + b*Sin[c + d*x]^2])/(2*(a + b)^2*d) + Sec[c + d*x]^2/(2*(a + b
)*d)

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 3273

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = Free
Factors[Sin[e + f*x]^2, x]}, Dist[ff^((m + 1)/2)/(2*f), Subst[Int[x^((m - 1)/2)*((a + b*ff*x)^p/(1 - ff*x)^((m
 + 1)/2)), x], x, Sin[e + f*x]^2/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \frac {\tan ^3(c+d x)}{a+b \sin ^2(c+d x)} \, dx &=\frac {\text {Subst}\left (\int \frac {x}{(1-x)^2 (a+b x)} \, dx,x,\sin ^2(c+d x)\right )}{2 d}\\ &=\frac {\text {Subst}\left (\int \left (\frac {1}{(a+b) (-1+x)^2}+\frac {a}{(a+b)^2 (-1+x)}-\frac {a b}{(a+b)^2 (a+b x)}\right ) \, dx,x,\sin ^2(c+d x)\right )}{2 d}\\ &=\frac {a \log (\cos (c+d x))}{(a+b)^2 d}-\frac {a \log \left (a+b \sin ^2(c+d x)\right )}{2 (a+b)^2 d}+\frac {\sec ^2(c+d x)}{2 (a+b) d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 52, normalized size = 0.81 \begin {gather*} \frac {a \left (2 \log (\cos (c+d x))-\log \left (a+b \sin ^2(c+d x)\right )\right )+(a+b) \sec ^2(c+d x)}{2 (a+b)^2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^3/(a + b*Sin[c + d*x]^2),x]

[Out]

(a*(2*Log[Cos[c + d*x]] - Log[a + b*Sin[c + d*x]^2]) + (a + b)*Sec[c + d*x]^2)/(2*(a + b)^2*d)

________________________________________________________________________________________

Maple [A]
time = 0.36, size = 58, normalized size = 0.91

method result size
derivativedivides \(\frac {-\frac {a \ln \left (a +b -b \left (\cos ^{2}\left (d x +c \right )\right )\right )}{2 \left (a +b \right )^{2}}+\frac {a \ln \left (\cos \left (d x +c \right )\right )}{\left (a +b \right )^{2}}+\frac {1}{2 \left (a +b \right ) \cos \left (d x +c \right )^{2}}}{d}\) \(58\)
default \(\frac {-\frac {a \ln \left (a +b -b \left (\cos ^{2}\left (d x +c \right )\right )\right )}{2 \left (a +b \right )^{2}}+\frac {a \ln \left (\cos \left (d x +c \right )\right )}{\left (a +b \right )^{2}}+\frac {1}{2 \left (a +b \right ) \cos \left (d x +c \right )^{2}}}{d}\) \(58\)
risch \(\frac {2 \,{\mathrm e}^{2 i \left (d x +c \right )}}{d \left (a +b \right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d \left (a^{2}+2 a b +b^{2}\right )}-\frac {a \ln \left ({\mathrm e}^{4 i \left (d x +c \right )}-\frac {2 \left (2 a +b \right ) {\mathrm e}^{2 i \left (d x +c \right )}}{b}+1\right )}{2 d \left (a^{2}+2 a b +b^{2}\right )}\) \(114\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^3/(a+sin(d*x+c)^2*b),x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/2*a/(a+b)^2*ln(a+b-b*cos(d*x+c)^2)+a/(a+b)^2*ln(cos(d*x+c))+1/2/(a+b)/cos(d*x+c)^2)

________________________________________________________________________________________

Maxima [A]
time = 0.34, size = 82, normalized size = 1.28 \begin {gather*} -\frac {\frac {a \log \left (b \sin \left (d x + c\right )^{2} + a\right )}{a^{2} + 2 \, a b + b^{2}} - \frac {a \log \left (\sin \left (d x + c\right )^{2} - 1\right )}{a^{2} + 2 \, a b + b^{2}} + \frac {1}{{\left (a + b\right )} \sin \left (d x + c\right )^{2} - a - b}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*sin(d*x+c)^2),x, algorithm="maxima")

[Out]

-1/2*(a*log(b*sin(d*x + c)^2 + a)/(a^2 + 2*a*b + b^2) - a*log(sin(d*x + c)^2 - 1)/(a^2 + 2*a*b + b^2) + 1/((a
+ b)*sin(d*x + c)^2 - a - b))/d

________________________________________________________________________________________

Fricas [A]
time = 0.43, size = 78, normalized size = 1.22 \begin {gather*} -\frac {a \cos \left (d x + c\right )^{2} \log \left (-b \cos \left (d x + c\right )^{2} + a + b\right ) - 2 \, a \cos \left (d x + c\right )^{2} \log \left (-\cos \left (d x + c\right )\right ) - a - b}{2 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} d \cos \left (d x + c\right )^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*sin(d*x+c)^2),x, algorithm="fricas")

[Out]

-1/2*(a*cos(d*x + c)^2*log(-b*cos(d*x + c)^2 + a + b) - 2*a*cos(d*x + c)^2*log(-cos(d*x + c)) - a - b)/((a^2 +
 2*a*b + b^2)*d*cos(d*x + c)^2)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan ^{3}{\left (c + d x \right )}}{a + b \sin ^{2}{\left (c + d x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**3/(a+b*sin(d*x+c)**2),x)

[Out]

Integral(tan(c + d*x)**3/(a + b*sin(c + d*x)**2), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 234 vs. \(2 (60) = 120\).
time = 0.76, size = 234, normalized size = 3.66 \begin {gather*} -\frac {\frac {a \log \left (a - \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {4 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}{a^{2} + 2 \, a b + b^{2}} - \frac {2 \, a \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right )}{a^{2} + 2 \, a b + b^{2}} + \frac {3 \, a + \frac {10 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {4 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {3 \, a {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}{{\left (a^{2} + 2 \, a b + b^{2}\right )} {\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}^{2}}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*sin(d*x+c)^2),x, algorithm="giac")

[Out]

-1/2*(a*log(a - 2*a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 4*b*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + a*(cos
(d*x + c) - 1)^2/(cos(d*x + c) + 1)^2)/(a^2 + 2*a*b + b^2) - 2*a*log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1
) - 1))/(a^2 + 2*a*b + b^2) + (3*a + 10*a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 4*b*(cos(d*x + c) - 1)/(cos(
d*x + c) + 1) + 3*a*(cos(d*x + c) - 1)^2/(cos(d*x + c) + 1)^2)/((a^2 + 2*a*b + b^2)*((cos(d*x + c) - 1)/(cos(d
*x + c) + 1) + 1)^2))/d

________________________________________________________________________________________

Mupad [B]
time = 14.28, size = 52, normalized size = 0.81 \begin {gather*} -\frac {a\,\left (\frac {\ln \left (\left (a+b\right )\,{\mathrm {tan}\left (c+d\,x\right )}^2+a\right )}{2}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^2}{2}\right )-\frac {b\,{\mathrm {tan}\left (c+d\,x\right )}^2}{2}}{d\,{\left (a+b\right )}^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^3/(a + b*sin(c + d*x)^2),x)

[Out]

-(a*(log(a + tan(c + d*x)^2*(a + b))/2 - tan(c + d*x)^2/2) - (b*tan(c + d*x)^2)/2)/(d*(a + b)^2)

________________________________________________________________________________________